let arr = ['3.3.3.3.3.3.3', '6.6', '1.5', '1.36.7.888', '1.45']
function sort(arr) {
  for (let i = 0; i < arr.length; i++) {
    for (let j = i + 1; j < arr.length; j++) {
      console.log(judge(arr[i], arr[j]))
      if (judge(arr[i], arr[j])) {
        let t = arr[i]
        arr[i] = arr[j]
        arr[j] = t

      }
    }
  }
  return arr
}
function judge(a, b) {
  let len = Math.max(a.length, b.length)
  let i = 0
  let j = 0
  let left = a.split('.')
  let right = b.split('.')
  while (i < len && j < len) {
    if (Number([left[i]]) > Number([right[j]])) {
      return true
    } else if (Number([left[i]]) < Number([right[j]])) {
      return false
    }
    else {
      i++
      j++
    }
  }
}
console.log(sort(arr))